package main

import "github.com/gin-gonic/gin"

func main() {
	r := gin.Default()
	r.GET("/testCookie", HandlerA)
	r.Run()

}

func HandlerA(c *gin.Context) {
	userName, err := c.Cookie("userName")
	if err != nil {
		userName = "Benjamin"
		c.SetCookie("userName", userName, 60*60, "/", "localhost", false, true)
	}
	c.String(200, "testCookie")
}
